package com.hotel_management_backstage.lin.service.staffManagement;

import com.hotel_management_backstage.lin.dao.staffManagement.SysDepartmentMapper;
import com.hotel_management_backstage.lin.entity.staffManagement.SysDepartment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysDepartmentService {

    @Autowired
    private SysDepartmentMapper sysDepartmentMapper;

    List<SysDepartment> selectAllDepartment(){
        return sysDepartmentMapper.selectAllDepartment();
    }

    SysDepartment selectDepartmentById(int id){
        return sysDepartmentMapper.selectDepartmentById(id);
    }

    void insertSysDepartment(SysDepartment sysDepartment){
        sysDepartmentMapper.insertSysDepartment(sysDepartment);
    }

    void updateSysDepartment(SysDepartment sysDepartment){
        sysDepartmentMapper.updateSysDepartmentById(sysDepartment);
    }

    SysDepartment selectSysDepartmentByDepartmentName(String departmentName){
        return sysDepartmentMapper.selectSysDepartmentByDepartmentName(departmentName);
    }
}
